$(document).ready(function () {
    var lineChart = echarts.init(document.getElementById("echarts-line-chart"));
    var lineoption = {
        title: {
            text: '',
            subtext: ''
        },
        tooltip: {
            trigger: 'axis'
        },
        legend: {
            data:[]
        },
        toolbox: {
            show: true,
            feature: {
                dataZoom: {
                    yAxisIndex: 'none'
                },
                dataView: {readOnly: false},
                magicType: {type: ['line', 'bar']},
                restore: {},
                saveAsImage: {}
            }
        },
        xAxis:  {
            type: 'category',
            boundaryGap: false,
            data: ['0:00','3:00','6:00','9:00','12:00','15:00','18:00','21:00']
        },
        yAxis: {
            type: 'value',
            axisLabel: {
                formatter: '{value}'
            },
            min:5,
            max:30
        },
        grid:{
            x:30,
            x2:40,
            y2:30
        },
        series: [
            {
                name:'耗电',
                type:'line',
                data:[11, 11, 15, 13, 12, 13, 10,20,8],
                itemStyle : {  
                    normal : {  
                        color:'#1ab394',  
                        lineStyle:{  
                            color:'#1ab394'  
                        }  
                    }  
                },  
                markPoint: {
                    data: [
                        {type: 'max', name: '最大值'},
                        {type: 'min', name: '最小值'}
                    ]
                },
                markLine: {
                    data: [
                        {type: 'average', name: '平均值'}
                    ]
                }
            }
        ]
    };
    lineChart.setOption(lineoption);
    var twoChart = echarts.init(document.getElementById("echarts-line-chart-two"));
    var twooption = {
        title: {
            text: '',
            subtext: ''
        },
        tooltip: {
            trigger: 'axis'
        },
        legend: {
            data:[]
        },
        toolbox: {
            show: true,
            feature: {
                dataZoom: {
                    yAxisIndex: 'none'
                },
                dataView: {readOnly: false},
                magicType: {type: ['line', 'bar']},
                restore: {},
                saveAsImage: {}
            }
        },
        xAxis:  {
            type: 'category',
            boundaryGap: false,
            data: ['周一','周二','周三','周四','周五','周六','周日']
        },
        yAxis: {
            type: 'value',
            axisLabel: {
                formatter: '{value}'
            },
            min:5,
            max:30
        },
        grid:{
            x:30,
            x2:50,
            y2:30
        },
        series: [
            {
                name:'耗电',
                type:'line',
                data:[11, 11, 15, 13, 12, 13, 10],
                itemStyle : {  
                    normal : {  
                        color:'#1ab394',  
                        lineStyle:{  
                            color:'#1ab394'  
                        }  
                    }  
                },  
                markPoint: {
                    data: [
                        {type: 'max', name: '最大值'},
                        {type: 'min', name: '最小值'}
                    ]
                },
                markLine: {
                    data: [
                        {type: 'average', name: '平均值'}
                    ]
                }
            }
        ]
    };
    twoChart.setOption(twooption);
    var threeChart = echarts.init(document.getElementById("echarts-line-chart-three"));
    var threeoption = {
        title: {
            text: '',
            subtext: ''
        },
        tooltip: {
            trigger: 'axis'
        },
        legend: {
            data:[]
        },
        toolbox: {
            show: true,
            feature: {
                dataZoom: {
                    yAxisIndex: 'none'
                },
                dataView: {readOnly: false},
                magicType: {type: ['line', 'bar']},
                restore: {},
                saveAsImage: {}
            }
        },
        xAxis:  {
            type: 'category',
            boundaryGap: false,
            data: ['第一周','第二周','第三周','第四周']
        },
        yAxis: {
            type: 'value',
            axisLabel: {
                formatter: '{value}'
            },
            min:5,
            max:30
        },
        grid:{
            x:30,
            x2:50,
            y2:30
        },
        series: [
            {
                name:'耗电',
                type:'line',
                data:[ 11, 15, 13, 13, 10],
                itemStyle : {  
                    normal : {  
                        color:'#1ab394',  
                        lineStyle:{  
                            color:'#1ab394'  
                        }  
                    }  
                },  
                markPoint: {
                    data: [
                        {type: 'max', name: '最大值'},
                        {type: 'min', name: '最小值'}
                    ]
                },
                markLine: {
                    data: [
                        {type: 'average', name: '平均值'}
                    ]
                }
            }
        ]
    };
    threeChart.setOption(threeoption);
    var fourChart = echarts.init(document.getElementById("echarts-line-chart-four"));
    var fouroption = {
        title: {
            text: '',
            subtext: ''
        },
        tooltip: {
            trigger: 'axis'
        },
        legend: {
            data:[]
        },
        toolbox: {
            show: true,
            feature: {
                dataZoom: {
                    yAxisIndex: 'none'
                },
                dataView: {readOnly: false},
                magicType: {type: ['line', 'bar']},
                restore: {},
                saveAsImage: {}
            }
        },
        xAxis:  {
            type: 'category',
            boundaryGap: false,
            data: ['第一季度','第二季度','第三季度','第四季度']
        },
        yAxis: {
            type: 'value',
            axisLabel: {
                formatter: '{value}'
            },
            min:5,
            max:30
        },
        grid:{
            x:30,
            x2:50,
            y2:30
        },
        series: [
            {
                name:'耗电',
                type:'line',
                data:[21,18,28,24],
                itemStyle : {  
                    normal : {  
                        color:'#1ab394',  
                        lineStyle:{  
                            color:'#1ab394'  
                        }  
                    }  
                },  
                markPoint: {
                    data: [
                        {type: 'max', name: '最大值'},
                        {type: 'min', name: '最小值'}
                    ]
                },
                markLine: {
                    data: [
                        {type: 'average', name: '平均值'}
                    ]
                }
            }
        ]
    };
    fourChart.setOption(fouroption);
    

});